package edu.zut.hb.software.teacher.service.impl;

import edu.zut.hb.software.base.service.impl.GenericManagerImpl;
import edu.zut.hb.software.teacher.dao.TeacherDao;
import edu.zut.hb.software.teacher.domain.Teacher;
import edu.zut.hb.software.teacher.service.TeacherService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;


@Service
@Transactional
public class TeacherServiceImpl extends GenericManagerImpl<Teacher,Long> implements TeacherService {

    TeacherDao teacherDao;

    @Autowired
    public void setTeacherDao(TeacherDao teacherDao) {
        this.teacherDao = teacherDao;
        this.dao=this.teacherDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            Teacher teacher = new Teacher();
            teacher.setName("第"+i+"个老师");
            teacher.setNum(i);
            teacher.setStatus(true);
            list.add(teacher);
        }
        return list;
    }
}
